package com.weiyin.examination.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.Window;
import android.view.WindowManager;

import com.weiyin.examination.application.App;
import com.weiyin.examination.util.StatusUtils;
import com.weiyin.examination.util.ToastUtil;

/**
 * @author njf
 * @date 2017/9/11
 */

public class BaseActivity extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        StatusUtils.setStatus(this);
        App.getInstance().addActivity2Stack(this);
        //无title
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
    }

    public void showToast(String text){
        ToastUtil.showTextToast(this,text);
    }
    @Override
    protected void onDestroy() {
        App.getInstance().removeActivityFromStack(this);
        super.onDestroy();
    }
}
